<template>
  <div class="child">
    <h2>child</h2>
    <input
      type="text"
      v-model="son"
    />
  </div>
</template>
<script>
export default {
  props: ['msg'],
  data() {
    return {
      son: '子组件'
    }
  },
  watch: {
    msg(val) {
      this.son = val
    },
    son(val) {
      this.$emit('update:msg', val)
    }
  }
}
</script>
<style lang="scss" scoped></style>
